[#Line : EI Consignee]
Add : Option : TlyErp_Qr_Ledcontct :@@IsSales

[!Line : TlyErp_Qr_Ledcontct]

Add : Fields: Medium Prompt, TlyErp_Qr_Ledcontct

Local : Field : Medium Prompt : Info : $$LocaleString:"WhatsApp No :"
Local : Field : Medium Prompt : width : @@ShortWidth


[Field : TlyErp_Qr_Ledcontct]
Use : Name Field
Set as   : $LedgerMobile:Ledger:$LedgerName
Set Always : Yes

;;-----------------------------------------;;



[#Form: Sales Color]

        On : Form Accept : $$InAlterMode  : CALL : TlyErp_Whats_Qr_Msg
        On : Form Accept : $$InCreateMode : CALL : TlyErp_Whats_Qr_Msg

    Add : Button : TlyErpPDFBtn
[Button: TlyErpPDFBtn]

    Title: "Create PDF"
    Key : Ctrl + F
    Action : Call: TlyErp_Whats_Qr_Msg



    
[Function: TlyErp_Whats_Qr_Msg]

    10 : QUERYBOX : "Do you want to send" +$$NewLine + $$NewLine + "Invoice details on whatsapp ?" : Yes:No
    20 : IF : Not $$LastResult
    30 :    Continue
    40 : ENDIF
    50 : Display : TlyErp_Qr_Reports



[Report: TlyErp_Qr_Reports]

    Form    :    TlyErp_Qr_Form
    Title   :    "QR Code Details"

[Form: TlyErp_Qr_Form]

    Parts    :    TlyErp_Qr_Parts 
    

    VerticalAlign   : Center
    HorizontalAlign : Center

    Height  : 60% Page
    Width   : 25% Page
[Part: TlyErp_Qr_Parts]

Part: TlyErp_Qr_SubTitle, TlyErp_Qr_Part

Vertical    : Yes

Space Left  : 1
Space Right : 1

[Part: TlyErp_Qr_SubTitle]

    Line    :    TlyErp_Qr_SubTitle
    Background  : @@SV_VCHTYPE

[Line: TlyErp_Qr_SubTitle]

    Fields : Form Sub Title
    Local  :    Field    :    Form Sub Title  :    Set as   :    "Send Message thru" +$$NewLine + "WhatsApp" +$$NewLine + "91"+ #TlyErp_Qr_Ledcontct
    Local  :    Field    :    Form Sub Title  :    Align    :    Center
    Local  :    Field    :    Form Sub Title  :    Color    :    @@SV_VCHCOLOR
    Local  :    Field    :    Form Sub Title  :    Style    :    Normal Bold Italic
    Local  :    Field    :    Form Sub Title  :    Lines    :    0
Local  :    Field    :    Form Sub Title  :widespace:yes


[Part: TlyErp_Qr_Part]

   Line            : Empty


   QR Code         : ($$String:@@AS+"91"+$$String:@@DMKDS+$$String:@@TlyErp_Msg):True
   ;($$String:"whatsapp://send?Phone=91"+$$String:@@DMKDS+$$String:@@TlyErp_Msg):True
 
   Width           : 50% screen
   Height          : 50% screen
   Space Top       : 0.5

   VerticalAlign   : Center
   HorizontalAlign : Center


[System: Formulae]
    AS:"https://api.whatsapp.com/send/?phone=";"whatsapp://send?Phone="
    DMKDS:#TlyErp_Qr_Ledcontct
    TlyErp_Mob : $$String:"91" + $Ledgermobile:Ledger:$Ledgername
    TlyErp_Msg : "&text=Dear%20Customer%20,"+"Your%20Invoice%20No:%20"+$$String:$VoucherNumber+",%20*Amount%20"+$$String:$amount+"%20Date%20"+$$String:##VARVchDate+",%20has%20been%20Generated.%20"+"%20Regards%20"+
    +$$StringFindAndReplace:@@CmpMailName:" ":"%20"